package top.yueyazhui.account.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface AccountMapper {

    @Update("update account_tbl set money = money - #{money} where user_id = #{userId}")
    int updateAccount(@Param("userId") String userId, @Param("money") Double money);

    @Select("select money from account_tbl where user_id = #{userId}")
    Double getMoneyByAccount(@Param("userId") String userId);
}
